//
//  Student.swift
//  WebSocket
//
//  Created by yaqiang bi on 2017/5/3.
//
//
import Foundation
import Cocoa
import PerfectWebSockets
import PerfectHTTP
func makeRoutes()->Route{
    let route = Route(method: .get, uri: "/list") { (request, response) in
        let data = [
            ["name":"小明","age":12,"sex":"man"],
            ["name":"小红","age":16,"sex":"woman"]
        ]
        
        do{
            try response.setBody(json: data)
        }catch{
            fatalError("\(error)")
        }
        response.completed()
    }
    return route
}
